package com.ruoyi.purchase.domain;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName po_purchase
 */
@TableName(value ="po_purchase")
@Data
public class PoPurchase implements Serializable {
    /**
     * 采购单编号=CG + 当前时间毫秒数
     */
    @TableId
    private String purId;

    /**
     * 采购人id
     */
    @TableField(fill = FieldFill.INSERT)
    private Integer sysCreateUserId;

    /**
     * 采购人姓名
     */
    @TableField(exist = false)
    private String pUsername;

    /**
     * 审核人id
     */
    private Integer sysCheckUserId;

    /**
     * 审核人姓名
     */
    @TableField(exist = false)
    private String cUsername;

    /**
     * 采购时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date purTime;

    /**
     * 审核时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date checkTime;

    /**
     * 审核意见
     */
    private String opinion;

    /**
     * 仓库id
     */
    private Integer repoWareId;

    /**
     * 0(未入库)1(入库)状态
     */
    private Integer rkState;

    /**
     * 总金额
     */
    private Double total;

    /**
     * 未审核1 审核中2
     */
    private String status;

    /**
     * 品牌名称
     */
    @TableField(exist = false)
    private String brandName;

    /**
     * 商品类型名称(手机，电脑...)
     */
    @TableField(exist = false)
    private String typeName;

    /**
     * 商品型号名称
     */
    @TableField(exist = false)
    private String productModel;

    /**
     * 厂商名称
     */
    @TableField(exist = false)
    private String firmName;

    /**
     * 厂商Id
     */
    @TableField(exist = false)
    private Integer firmId;

    /**
     * 数量
     */
    @TableField(exist = false)
    private Integer num;

    /**
     * 进价
     */
    @TableField(exist = false)
    private Double buyPrice;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PoPurchase other = (PoPurchase) that;
        return (this.getPurId() == null ? other.getPurId() == null : this.getPurId().equals(other.getPurId()))
            && (this.getSysCreateUserId() == null ? other.getSysCreateUserId() == null : this.getSysCreateUserId().equals(other.getSysCreateUserId()))
            && (this.getSysCheckUserId() == null ? other.getSysCheckUserId() == null : this.getSysCheckUserId().equals(other.getSysCheckUserId()))
            && (this.getPurTime() == null ? other.getPurTime() == null : this.getPurTime().equals(other.getPurTime()))
            && (this.getCheckTime() == null ? other.getCheckTime() == null : this.getCheckTime().equals(other.getCheckTime()))
            && (this.getOpinion() == null ? other.getOpinion() == null : this.getOpinion().equals(other.getOpinion()))
            && (this.getRepoWareId() == null ? other.getRepoWareId() == null : this.getRepoWareId().equals(other.getRepoWareId()))
            && (this.getRkState() == null ? other.getRkState() == null : this.getRkState().equals(other.getRkState()))
            && (this.getTotal() == null ? other.getTotal() == null : this.getTotal().equals(other.getTotal()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPurId() == null) ? 0 : getPurId().hashCode());
        result = prime * result + ((getSysCreateUserId() == null) ? 0 : getSysCreateUserId().hashCode());
        result = prime * result + ((getSysCheckUserId() == null) ? 0 : getSysCheckUserId().hashCode());
        result = prime * result + ((getPurTime() == null) ? 0 : getPurTime().hashCode());
        result = prime * result + ((getCheckTime() == null) ? 0 : getCheckTime().hashCode());
        result = prime * result + ((getOpinion() == null) ? 0 : getOpinion().hashCode());
        result = prime * result + ((getRepoWareId() == null) ? 0 : getRepoWareId().hashCode());
        result = prime * result + ((getRkState() == null) ? 0 : getRkState().hashCode());
        result = prime * result + ((getTotal() == null) ? 0 : getTotal().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        return "PoPurchase{" +
                "purId='" + purId + '\'' +
                ", sysCreateUserId=" + sysCreateUserId +
                ", pUsername='" + pUsername + '\'' +
                ", sysCheckUserId=" + sysCheckUserId +
                ", cUsername='" + cUsername + '\'' +
                ", purTime=" + purTime +
                ", checkTime=" + checkTime +
                ", opinion='" + opinion + '\'' +
                ", repoWareId=" + repoWareId +
                ", rkState=" + rkState +
                ", total=" + total +
                ", status='" + status + '\'' +
                '}';
    }
}